package org.example.maven.controller;


import org.example.maven.entity.IdentityName;
import org.example.maven.pojo.Result;
import org.example.maven.service.IIdentityNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zafkiel
 * @since 2025-07-30
 */
@RestController
@RequestMapping("/identity")
public class IdentityNameController {
    @Autowired
    private IIdentityNameService identityNameService;
    //进行身份添加
    @PostMapping
    @PreAuthorize("permitAll()")
    public Result addIdentityName(@RequestBody IdentityName addIdentityName){
        System.out.println(addIdentityName);
        identityNameService.addIdentityName(addIdentityName);
        return Result.success();
    }

}
